package com.GUI.Lesson06;
//文本域
import javax.swing.*;
import java.awt.*;

public class TextDemo04 extends JFrame {
    public TextDemo04(){
        Container container = this.getContentPane();

        //文本域
        JTextArea textArea = new JTextArea(20, 20);
        textArea.setText("123456");
        //面板
        JScrollPane scrollPane = new JScrollPane(textArea);
        container.add(scrollPane);

        //基本
        this.setVisible(true);//没有命名冲突的话才可以省略this
        this.setBounds(10,10,200,200);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    }

    public static void main(String[] args) {
        new TextDemo04();
    }
}